package com.chance.cc.crawler.development.command.trigger.domain.baidu;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.BaiDuCommonScript;
import com.chance.cc.crawler.development.command.job.domain.baidu.realtime.BaiJiaHaoRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.trace.BaiJiaHaoCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.trace.BaiJiaHaoTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.CommonCrawlerTestSchedulerTrigger;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-06 14:44:00
 * @email okprog@sina.com
 */
public class BaiJiaHaoCrawlerSchedulerTrigger extends CommonCrawlerTestSchedulerTrigger {
    public static void main(String[] args) {

        publishBaiJiaHaoRealtimeCrawlerScheduleTriggerInfo();

        publishBaiJiaHaoTraceCrawlerScheduleTriggerInfo();

        publishBaiJiaHaoCommentTraceCrawlerScheduleTriggerInfo();

    }

    /**
     * 发布百家号关键词2小时采集实时任务trigger info

     */
    public static void publishBaiJiaHaoRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiJiaHaoRealtimeCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/30 * * * ?",
                "百家号关键词实时采集任务执行，每三十分钟执行一次"
        );
    }

    /**
     * 发布百家号关键词采集回溯任务trigger info

     */
    public static void publishBaiJiaHaoTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiJiaHaoTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 * * ?",
                "百家号关键词24小时回溯采集任务执行，每天执行一次"
        );
    }

    /**
     * 发布百家号关键词采集回溯任务trigger info

     */
    public static void publishBaiJiaHaoCommentTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiJiaHaoCommentTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "百家号关键词实时回溯评论采集任务执行，每小时执行一次"
        );
    }
}
